<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="StringUtil,org.ascollada.utils.StringUtil,isWhitespace,substitute,trim,trimArrayElements" name="keywords">
<title>org.ascollada.utils.StringUtil</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'StringUtil - Papervision3D 3dcnapi文档';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Papervision3D 3dcnapi文档</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">全部包</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">全部类</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">引索</a>&nbsp;|&nbsp;<a href="../../../index.html?org/ascollada/utils/StringUtil.html&amp;org/ascollada/utils/class-list.html" id="framesLink1">框架</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">无框架</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="3dcnapi Logo" title="3dcnapi Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">类&nbsp;StringUtil</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">方法</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("类 StringUtil"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">包</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.ascollada.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">类</td><td class="classSignature">public class StringUtil</td>
</tr>
</table>
<p></p>
   The StringUtil utility class is an all-static class with methods for
   working with String objects within Flex.
   You do not create instances of StringUtil;
   instead you call methods such as 
   the <code>StringUtil.substitute()</code> method.  
  <p>StringUtil 类是一个纯静态类，它的方法主要用于flex中处理字符串对象.你不能建立StringUtil的实例;请使用StringUtil.substitute()这样的方式来调用方法.</p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">公共方法</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">方法</th><th colspan="2">定义方</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#isWhitespace()">isWhitespace</a>(character:String):Boolean</div>
<div class="summaryTableDescription">
  <p>[静态]
    Returns <code>true</code> if the specified string is
    a single space, tab, carriage return, newline, or formfeed character.</p>
  <p>如果参数字符串是一个空格、制表、回车、换行、换页符时返回true.</p>
</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#substitute()">substitute</a>(str:String, ... rest):String</div>
<div class="summaryTableDescription">[静态]
       Substitutes "{n}" tokens within the specified string
       with the respective arguments passed in.</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#trim()">trim</a>(str:String):String</div>
<div class="summaryTableDescription">
  <p>[静态]
    Removes all whitespace characters from the beginning and end
    of the specified string.</p>
  <p>移除字符串中的所有空白符.</p>
</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#trimArrayElements()">trimArrayElements</a>(value:String, delimiter:String):String</div>
<div class="summaryTableDescription">
  <p>[静态]
    Removes all whitespace characters from the beginning and end
    of each element in an Array, where the Array is stored as a String.</p>
  <p>移除数组中每个元素的空白符,  数组保存的是一个字符串.</p>
</div>
</td><td class="summaryTableOwnerCol">StringUtil</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">方法详细信息</div>
<a name="isWhitespace()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isWhitespace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">方法</td>
</tr>
</table>
<div class="detailBody">
<code>public static function isWhitespace(character:String):Boolean</code><p>
       Returns <code>true</code> if the specified string is
       a single space, tab, carriage return, newline, or formfeed character.
             </p>
<p>如果参数字符串是一个空格、制表、回车、换行、换页符时返回true.</p>
<span class="label">参数</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">character</span>:String</code> &mdash; The String that is is being queried. 
             </td>
</tr>
</table>
<p></p>
<span class="label">返回</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; <code>true</code> if the specified string is
       a single space, tab, carriage return, newline, or formfeed character.
      </td>
</tr>
</table>
<p>如果参数字符串是一个空格、制表、回车、换行、换页符时返回true.</p>
</div>
<a name="substitute()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">substitute</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">方法</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function substitute(str:String, ... rest):String</code>
<p>
       Substitutes "{n}" tokens within the specified string
       with the respective arguments passed in.
             使用指定的字符串替换传入的各个参数中的&quot;{n}&quot;记号.</p><span class="label">参数</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><p><code><span class="label">str</span>:String</code> &mdash; The string to make substitutions in.
  This string can contain special tokens of the form
  <code>{n}</code>, where <code>n</code> is a zero based index,
  that will be replaced with the additional parameters
  found at that index if specified.
</p>
  <p>被替换的字符串,它包含{n}中的特别记号,当n是以基于零为索引时，如果有附加参数，它将被替换掉.</p></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><p><code>... <span class="label">rest</span></code> &mdash; Additional parameters that can be substituted
  in the <code>str</code> parameter at each <code>{n}</code>
  location, where <code>n</code> is an integer (zero based)
  index value into the array of values specified.
  If the first parameter is an array this array will be used as
  a parameter list.
  This allows reuse of this routine in other methods that want to
  use the ... rest signature.
</p>
<p>附加的参数能替换str参数中的每个{n}的位置，n是指定数组中一个整型(基于0)的索引值。如果第一个参数是一个数组,它将被当作一个参数列表.这使得使用 ... rest 记号的其它方法中可以重用这个程序.</p><pre>
          public function myTracer(str:String, ... rest):void
          { 
              label.text += StringUtil.substitute(str, rest) + "\n";
          } </pre>
             </td>
</tr>
</table>
<p></p>
<span class="label">返回</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; New string with all of the <code>{n}</code> tokens
       replaced with the respective arguments specified.
             </td>
</tr>
</table>
返回替换{n}记号后的新字符串
<p><br>
  <span class="label">Example</span>
  <br>             
  var str:String = "here is some info '{0}' and {1}";
  trace(StringUtil.substitute(str, 15.4, true));
  // this will output the following string:
  // "here is some info '15.4' and true"</p>
<p> //
输出下面字符串 "here is some info '15.4' and true"</p>
<p></p>
</div>
<a name="trim()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">trim</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">方法</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function trim(str:String):String</code><p>
       Removes all whitespace characters from the beginning and end
       of the specified string.
             移除字符串中的所有空白符.</p><span class="label">参数</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">str</span>:String</code> &mdash; The String whose whitespace should be trimmed. 
             </td>
</tr>
</table>
被处理的字符串.
<p></p>
<span class="label">返回</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Updated String where whitespace was removed from the 
       beginning and end. 
      </td>
</tr>
</table>
返回移除空白符后的字符串.
</div>
<a name="trimArrayElements()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">trimArrayElements</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">方法</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function trimArrayElements(value:String, delimiter:String):String</code><p>
       Removes all whitespace characters from the beginning and end
       of each element in an Array, where the Array is stored as a String. 
             </p>
<p>移除集合中每个元素的空白符,  集合存储为字符串.</p>
<span class="label">参数</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:String</code> &mdash; The String whose whitespace should be trimmed. 
             被处理的字符串.</td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td>
<td><code><span class="label">delimiter</span>:String</code> &mdash; The String that delimits each Array element in the string.
             字符串集合中每个元素的分割符.</td>
</tr>
</table>
<p></p>
<span class="label">返回</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Updated String where whitespace was removed from the 
       beginning and end of each element. 
      </td>
</tr>
</table>
<p>返回移除空白符后的字符串.分割符仍然存在.</p>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">http://blog.papervision3d.org</center>
</div>
</body>
</html>
<!--http://blog.papervision3d.org-->
